Update gsk tests
authorMatthias Clasen <mclasen@redhat.com>
Wed, 2 Sep 2020 22:05:16 +0000 (18:05 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 4 Sep 2020 17:19:01 +0000 (13:19 -0400)
Add a clip-coordinates-2d test that is similar
to clip-coordinates-3d, but actually uses a 2D
transform.

testsuite/gsk/compare/clip-coordinates-2d.node [new file with mode: 0644]
testsuite/gsk/compare/clip-coordinates-2d.png [new file with mode: 0644]
testsuite/gsk/meson.build

diff --git a/testsuite/gsk/compare/clip-coordinates-2d.node b/testsuite/gsk/compare/clip-coordinates-2d.node
new file mode 100644 (file)
index 0000000..973f50e
--- /dev/null
@@ -0,0 +1,22 @@
+/* This test checks that we get sharp clip boundaries
+ * for 2d transforms. Compare with clip-coordinates-3d.node,
+ * which uses a general transform and gets offscreen
+ * rendering with GL_LINEAR.
+ */
+transform {
+  transform: scale(2);
+  child: container {
+    color {
+      bounds: 0 0 50 50;
+      color: transparent;
+    }
+
+    clip {
+      clip: 10 10 30 30;
+      child: color {
+        bounds: 0 0 50 50;
+        color: red;
+      }
+    }
+  }
+}
diff --git a/testsuite/gsk/compare/clip-coordinates-2d.png b/testsuite/gsk/compare/clip-coordinates-2d.png
new file mode 100644 (file)
index 0000000..1da0014
Binary files /dev/null and b/testsuite/gsk/compare/clip-coordinates-2d.png differ
index 01e6b38a74beb29b66321695cdd2bab5af3c66d2..e99f8dc1c26b45e7dcb0ee14f4df548d0d1c3e77 100644 (file)
@@ -22,6 +22,7 @@ node_parser = executable(
 compare_render_tests = [
   'blend-normal',
   'blend-difference',
+  'clip-coordinates-2d',
   'clip-coordinates-3d',
   'clipped_rounded_clip',
   'color-blur0',